package com.assignwork.modules.workarrange;

import com.assignwork.service.IWorkArrangeShipCabinInfoService;
import com.assignwork.vo.WorkArrangeMachinesVO;
import com.assignwork.vo.WorkArrangeShipCabinInfoVO;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.List;

/**
 * @ClassName WorkArrangeShipCabinInfoController
 * @Description 航运配工作业舱前端控制器
 * @Author dujianyu
 * @Date 2023/12/22 7:59
 */
@RestController
@AllArgsConstructor
@RequestMapping("workArrange/cabinInfo")
public class WorkArrangeShipCabinInfoController extends BladeController {

    private IWorkArrangeShipCabinInfoService service;

    @GetMapping("/infoByArrangeId")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "航运配工作业舱信息", notes = "传入arrangeId")
    public R<List<WorkArrangeShipCabinInfoVO>> infoByArrangeId(String arrangeId) {
        return R.data(service.infoByArrangeId(Func.toLong(arrangeId)));
    }

    @GetMapping("/allCabinLeftInfo")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "舱余吨", notes = "传入planId,assemblyLineId")
    public R<BigDecimal> allCabinLeftInfo(String planId, String assemblyLineId) {
        return R.data(service.allCabinLeftTon(Func.toLong(planId), Func.toLong(assemblyLineId)));
    }

}
